package com.ambimmort.shj.action.send.policy;

import com.ambimmort.shj.service.send.policy.SendPolicyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;

/**
 * Created by Josh on 2015/7/30.
 */
@Controller("/action/policy/hand_send_policy_queue.do")
public class HandSendPolicyQueue {
    @Autowired
    private SendPolicyService sendPolicyService;

    /**
     *
     * @param request
     * @param json
     * @return
     * @throws UnsupportedEncodingException
     */

    @RequestMapping("/action/policy/hand_send_policy_queue.do")
    @ResponseBody
    public String handSendPolicyQueue_policy(HttpServletRequest request, @RequestParam("json") String json) throws UnsupportedEncodingException {

        boolean flag= sendPolicyService.handSendPolicyQueue(json);
            if (flag) {
                return "{\"result\":\"true\"}";
            } else {
                return "{\"result\":\"false\"}";
            }
        }

}
